﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using YunBox2.Contracts.FoundationModels;

namespace YunBox2.DAL.Maps
{
    public class GoodsMap:ClassMap<Goods>
    {
        public GoodsMap()
        {
            Id(x => x.Id).Column("Id");

            Map(x => x.SerialNo).Column("SerialNo").Not.Nullable().Length(36);
            Map(x => x.Name).Column("Name").Not.Nullable().Length(250);
            Map(x => x.ShortName).Column("ShortName").Default("('')").Not.Nullable().Length(36);
            References(x => x.Unit).Column("UnitId").Not.Nullable();
            
            
            Map(x => x.LastModifiedTime).Column("LastModifiedTime");
            References(x => x.LastModifiedUser).Column("LastModifiedUserID");
            
            

            Table("Goods");
        }
    }
}
